<?php

$params = require(__DIR__ . '/../backend/config/params.php');
if (YII_ENV == 'dev') {
    $params['web_url'] = 'http://localhost/lcb/basic/web';
    $params['api_url'] = 'http://localhost/lcb/basic/api';
    $params['theme_url'] = 'http://localhost/lcb/basic/backend/themes';
    $params['img_host'] = 'http://localhost/ad/basic';
} else {
    $params['web_url'] = 'http://kpi.chindor.com/web';
    $params['api_url'] = 'http://kpi.chindor.com/api';
    $params['theme_url'] = 'http://kpi.chindor.com/backend/themes';
    $params['img_host'] = 'http://localhost/ad/basic';
}
//图片地址
$params['img_url'] = 'http://kpi.chindor.com';
$params['appkey']    = 'ccf8556a41023dbdc2724e9914ae4fbe';
$params['appsecret'] = '39f9ff1cb52d';
// $params['img_host'] = 'http://localhost/lcb/basic';
// $params['img_host'] = 'http://lcb.chindor.com';
// 
// 
// $params['img_url'] = 'http://lcb.chindor.com';

$config = [
    'id' => 'basic',
    'timeZone' => 'Asia/Shanghai',
    'language'=>'zh-CN',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'defaultRoute' => 'admin/default/index',
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => '9oVZ7xEIgyyBlpE5_Fp0WxDTCjahLrP1',
//            'enableCsrfValidation'=>false,
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => true,
        ],
        'errorHandler' => [
            'errorAction' => 'admin/default/error',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'db' => require(__DIR__ . '/db.php'),
    ],

    'params' => $params,
    'modules' => [
        'market' => [
            'class' => 'app\backend\modules\market\Module',
        ],
        'desktop' => [
            'class' => 'app\backend\modules\desktop\Module',
        ],
        'bank' => [
            'class' => 'app\backend\modules\bank\Module',
        ],
        'user' => [
            'class' => 'app\backend\modules\user\Module',
        ],
        'admin' => [
            'class' => 'app\backend\modules\admin\Module',
        ],
        'knowledge' => [
            'class' => 'app\backend\modules\knowledge\Module',
        ],
        'gii'  => [
            'class' => 'yii\gii\Module',
        ]
    ],
];



if (YII_ENV_DEV) {
//     configuration adjustments for 'dev' environment
//    $config['bootstrap'][] = 'debug';
//    $config['modules']['debug'] = [
//        'class' => 'yii\debug\Module',
//    ];

    // $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    ];
}

return $config;
